/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.click.app.service.impl;

import com.click.app.dao.FeatureProductDao;
import com.click.app.model.FeatureProduct;
import com.click.app.model.Product;
import com.click.app.service.FeatureProductManager;
import java.util.List;

/**
 *
 * @author arnold
 */
public class FeatureProductManagerImpl extends GenericManagerImpl<FeatureProduct, Long> implements FeatureProductManager {

    FeatureProductDao featureProductDao;

    public FeatureProductManagerImpl(FeatureProductDao featureProductDao) {
        super(featureProductDao);
        this.featureProductDao = featureProductDao;
    }

    public List<FeatureProduct> findById(Long id) {
        throw new UnsupportedOperationException("Not supported yet.");
    }


    public List<FeatureProduct> findByProduct(Product product) {
        return featureProductDao.findByProduct(product);
    }

    public List<FeatureProduct> findFeatureProducts() {
        return featureProductDao.findFeatureProducts();
    }

    public List<FeatureProduct> findFeatureProductsName(String name){
        return featureProductDao.findFeatureProductsName(name);
    }

    public FeatureProduct findFeatureProductsByDescription(String description){
        return featureProductDao.findFeatureProductsName(description).get(0);
    }


    public List<String> featureProductsNames(){
        return featureProductDao.featureProductsNames();
    }

    public List<FeatureProduct> findFeatureProductsByNameAndDescription(String name, String description){
        return featureProductDao.findFeatureProductsByNameAndDescription(name, description);
    }
}

